import request from '@/utils/request'

let ProductApi = {

  /*分类管理*/
  catList(data, errorback) {
    return request._post('/supplier/product.category/index', data, errorback);
  },
  /*分类添加*/
  catAdd(data, errorback) {
    return request._post('/supplier/product.category/add', data, errorback);
  },
  /*分类删除*/
  catDel(data, errorback) {
    return request._post('/supplier/product.category/delete', data, errorback);
  },
  /*分类修改*/
  catEdit(data, errorback) {
    return request._post('/supplier/product.category/edit', data, errorback);
  },
  /*产品列表*/
  productList(data, errorback) {
    return request._post('/supplier/product.product/index', data, errorback);
  },
  /*产品选择列表*/
  chooseLists(data, errorback) {
    return request._post('/supplier/data.product/lists', data, errorback);
  },
  /*规格选择列表*/
  chooseSpec(data, errorback) {
    return request._post('/supplier/data.product/spec', data, errorback);
  },
  /*新增产品*/
  addProduct(data, errorback) {
    return request._post('/supplier/product.product/add', data, errorback);
  },
  /*产品基础数据*/
  getBaseData(data, errorback) {
    return request._get('/supplier/product.product/add', data, errorback);
  },
  /*删除产品*/
  delProduct(data, errorback) {
    return request._post('/supplier/product.product/delete', data, errorback);
  },
  /*产品基础数据*/
  getEditData(data, errorback) {
    return request._get('/supplier/product.product/edit', data, errorback);
  },
  /*新增产品*/
  editProduct(data, errorback) {
    return request._post('/supplier/product.product/edit', data, errorback);
  },
  editProduct1(data, errorback) {
    return request._post('/supplier/wps.product/save', data, errorback);
  },
  /*新增规格组*/
  addSpec(data, errorback) {
    return request._post('/supplier/product.spec/addSpec', data, errorback);
  },
  /*新增规格值*/
  addSpecValue(data, errorback) {
    return request._post('/supplier/product.spec/addSpecValue', data, errorback);
  },
  /*商品列表不带分页*/
  getList(data, errorback) {
    return request._post('/supplier/data.product/lists', data, errorback);
  },
  /*商品列表不带分页*/
  getActiveProductList(data, errorback) {
    return request._post('/supplier/plus.fans.product/lists', data, errorback);
  },
  /*商品评论列表*/
  getCommentList(data, errorback) {
    return request._post('/supplier/product.comment/index', data, errorback);
  },
  /*获取评论详情*/
  getComment(data, errorback) {
    return request._post('/supplier/product.comment/detail', data, errorback);
  },
  /*获取评论详情*/
  editComment(data, errorback) {
    return request._post('/supplier/product.comment/edit', data, errorback);
  },
  /*删除评论*/
  delComment(data, errorback) {
    return request._post('/supplier/product.comment/delete', data, errorback);
  },
  /*得到分类图片*/
  cateImage(data, errorback) {
    return request._post('/supplier/product.category/image', data, errorback);
  },
  /*修改状态*/
  changeStatus(data, errorback) {
    return request._post('/supplier/product.product/state', data, errorback);
  },
   /*商品批量下架*/
   product_pl_xj(data, errorback) {
    return request._get('/supplier/product.product/pl_xj', data, errorback);
  },
  /*商品编辑规格名称*/
  product_edit_sku(data, errorback) {
    return request._get('/supplier/product.product/edit_sku', data, errorback);
  },
  //------------------------------云仓-------------------
  /*选品库商品列表*/
  yun_product_list(data, errorback) {
    return request._post('/supplier/wps.product/list', data, errorback);
  },
  /*加入我的选品*/
  yun_product_add(data, errorback) {
    return request._post('/supplier/wps.product/add', data, errorback);
  },
  /*批量加入我的选品*/
  yun_product_pl_add(data, errorback) {
    return request._post('/supplier/wps.product/pl_add', data, errorback);
  },
  /*选品库商品详情*/
  yun_product_info(data, errorback) {
    return request._post('/supplier/wps.product/info', data, errorback);
  },
  /*选品库商品详情*/
  supplier_index(data, errorback) {
    return request._get('/supplier/setting.supplier/index', data, errorback);
  },
}

export default ProductApi;
